package com.ymatou.apigateway.testcase;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.apigateway.parameter.AesUtil;
import com.ymatou.apigateway.parameter.GetproductListBean;
import com.ymatou.apigateway.parameter.OpenapiReq;
import com.ymatou.apigateway.parameter.ProductInfo;
import com.ymatou.apigateway.parameter.ProductList;
import com.ymatou.apigateway.service.GetproductListCall;
import com.ymatou.apigateway.service.OpenapiService;
import com.ymt.core.tool.FormatUtil;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.annotation.TestSuite;
import com.ymt.utils.tag.P1;
import com.ymttest.business.service.SellerProductCallService;
import com.ymttest.business.service.YMTTrading.TradingProductVo;
import com.ymttest.database.model.Application;
import com.ymttest.database.model.AuthCode;
import com.ymttest.database.sqlwapper.OpenApiWapper;
import com.ymttest.database.sqlwapper.YmtProductsIWapper;
import com.ymttest.utils.EnvSetup;
import com.ymttest.utils.TestDataManager;
import com.ymttest.utils.YMTDateUtil;
/**
*获取单个商品详细信息
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_GetProductList {
	private static OpenapiReq openapiReq;

	private static GetproductListBean getproductlistBean;
	private static GetproductListCall getproductlistCall;
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("获取单个商品详细信息");
	}

	@Before
	public void caseUp() {
		openapiReq = new OpenapiReq();
		openapiReq.setMethod("ymatou.products.list.get");

		getproductlistBean = new GetproductListBean();
		getproductlistCall = new GetproductListCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(getproductlistCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	
	@SuppressWarnings("rawtypes")
	public void verify(ProductList ProductList, int sellerId) throws InterruptedException {
		
		YmtProductsIWapper wapper = new YmtProductsIWapper();

		for (ProductInfo info1 : ProductList.getProduct_infos()) {

			String productID = info1.getProduct_id();
			Map product = wapper.getSellerProductDetailList_product(
					productID).get(0);
			Map catalogs = wapper.getSellerProductDetailList_Catalogs(
					productID, sellerId).get(0);
			
			Map catalogProperty = null;
			if (wapper.getSellerProductDetailList_CatalogProperty(productID).size() != 0) {
				catalogProperty = wapper.getSellerProductDetailList_CatalogProperty(productID).get(0);
			}

			Map productPicture = wapper
					.getSellerProductDetailList_ProductPicture(productID)
					.get(0);

			Logger.verifyEquals(product.get("CategoryName").toString(),
					info1.getCategory_name(), "验证返回category_name");
			Logger.verifyEquals("www.ymatou.com/product/" + productID
					+ ".html", info1.getProduct_url(), "验证返回product_url");
			Logger.verifyEquals(product.get("AddTime").toString()
					.subSequence(0, 19), info1.getCreate_time(),
					"验证返回create_time");
			Logger.verifyEquals(product.get("ValidStart").toString()
					.subSequence(0, 19), info1.getListing_start_time(),
					"验证返回listing_start_time");
			Logger.verifyEquals(product.get("BrandName").toString(),
					info1.getBrand_name(), "验证返回brand_name");
			Logger.verifyEquals(product.get("ProductName").toString(),
					info1.getProduct_name(), "验证返回product_name");
			Logger.verifyEquals(
					Integer.parseInt(product.get("BrandId").toString()),
					info1.getBrand_id(), "验证返回brand_id");
			Logger.verifyEquals(productPicture.get("PicUrl").toString(),
					info1.getProduct_images()[0], "验证返回product_images");
			Logger.verifyEquals(product.get("UpdateTime").toString()
					.subSequence(0, 19), info1.getUpdate_time(),
					"验证返回update_time");
			Logger.verifyEquals(
					Integer.parseInt(product.get("CategoryId").toString()),
					info1.getCategory_id(), "验证返回category_id");
			Logger.verifyEquals(Integer.parseInt(product.get(
					"CatalogStatus").toString()), info1.getDelivery_type(),
					"验证返回delivery_type");
			Logger.verifyEquals(product.get("ProductId").toString(),
					info1.getProduct_id(), "验证返回product_id");
			Logger.verifyEquals(product.get("ValidEnd").toString()
					.subSequence(0, 19), info1.getListing_end_time(),
					"验证返回listing_end_time");
			Logger.verifyEquals(
					Integer.parseInt(product.get("CatalogType").toString()) == 2,
					info1.isFbx(), "验证返回fbx");

			Logger.verifyEquals(
					Integer.parseInt(catalogs.get("WeightUnit").toString()),
					info1.getSkus().get(0).getWeight_unit(),
					"验证返回weight_unit");
			Logger.verifyEquals(
					0,
					info1.getSkus()
							.get(0)
							.getPrice()
							.compareTo(
									BigDecimal.valueOf(Float
											.parseFloat(catalogs.get(
													"Price").toString()))),
					"验证返回price");
			Logger.verifyEquals(
					Integer.parseInt(catalogs.get("StockNum").toString()),
					info1.getSkus().get(0).getStock_num(), "验证返回stock_num");
			Logger.verifyEquals(
					0,
					info1.getSkus()
							.get(0)
							.getWeight()
							.compareTo(
									BigDecimal.valueOf(Float
											.parseFloat(catalogs.get(
													"Weight").toString()))),
					"验证返回weight");
			Logger.verifyEquals(
					0,
					info1.getSkus()
							.get(0)
							.getNew_price()
							.compareTo(
									BigDecimal.valueOf(Float
											.parseFloat(catalogs.get(
													"NewPrice").toString()))),
					"验证返回new_price");
			Logger.verifyEquals(catalogs.get("CatalogId").toString(), info1
					.getSkus().get(0).getSku_id(), "验证返回sku_id");
			Logger.verifyEquals(
					0,
					info1.getSkus()
							.get(0)
							.getVip_price()
							.compareTo(
									BigDecimal.valueOf(Float
											.parseFloat(catalogs.get(
													"VipPrice").toString()))),
					"验证返回vip_price");
			Logger.verifyEquals(catalogs.get("SKU").toString(), info1
					.getSkus().get(0).getOuter_id(), "验证返回outer_id");
			
			if (catalogProperty != null) {
				Logger.verifyEquals(catalogProperty.get("PropertyName"), info1.getSkus().get(0)
						.getProperties().get(0).getName(), "验证返回properties Name");
				Logger.verifyEquals(catalogProperty.get("PropertyValue"), info1.getSkus().get(0)
						.getProperties().get(0).getValue(), "验证返回properties Value");
				Logger.verifyEquals(catalogProperty.get("PicUrl"), info1.getSkus().get(0)
						.getProperties().get(0).getPic_url(), "验证返回properties PicUrl");
			}
			
			Logger.verifyEquals(
					Integer.parseInt(catalogs.get("Action").toString()) == 0,
					info1.getSkus().get(0).getUsed(), "验证返回is_used");

		}
	}
	
	@SuppressWarnings({ "static-access" })
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetProductList_001() {
		Logger.start(true, "不传入更新时间，获取单个商品详细信息");
		try {
			int sellerId = Integer.valueOf(EnvSetup.getData("productsellerid"));
			String sellerName = EnvSetup.getData("productsellername");

			String productID = TradingProductVo.createPro((long) sellerId,
					sellerName, 10).getProductId();

			String productID2 = TradingProductVo.createPro((long) sellerId,
					sellerName, 10).getProductId();

			Thread.sleep(1000);

			List<String> productid_list = new ArrayList<>();
			productid_list.add(productID);
			productid_list.add(productID2);
			
			getproductlistBean.setProductid_list(productid_list);
			getproductlistBean.setPage_no(1);
			getproductlistBean.setPage_rows(10);

			OpenApiWapper openApiWapper = new OpenApiWapper();

			Application application = openApiWapper
					.selectApplicationBySellerId(
							Long.valueOf(EnvSetup.getData("productsellerid")))
					.get(0);

			String app_id = application.getApp_id();
			String app_secret = application.getApp_secret();

			AuthCode authCode = openApiWapper.selectAuthCodeByAppId(app_id)
					.get(0);

			openapiReq.setApp_id(app_id);
			openapiReq.setSign_method("MD5");
			openapiReq.setAuth_code(authCode.getAuth_code());
			openapiReq.setTimestamp(YMTDateUtil.getSysTime());
			openapiReq.setNonce_str(TestDataManager.getRandomNum(31));
			openapiReq.setBiz_content(new FormatUtil()
					.beanToGSONString(getproductlistBean));
			openapiReq.setSign(OpenapiService.generateMD5(openapiReq,
					AesUtil.decrypt(app_secret)));

			String url = String
					.format("http://apigateway.ymatou.com/apigateway/v1?app_id=%s&method=ymatou.products.list.get",
							app_id);
			getproductlistCall.setUrl(url);

			getproductlistCall.setData(openapiReq);
			getproductlistCall.callService();

			Logger.verifyEquals("0000", getproductlistCall.getCode(),
					"验证返回Code");

			ProductList ProductList = getproductlistCall.getProductList();
			Logger.verifyEquals(2, ProductList.getTotal_count(),
					"验证返回total_count");
			this.verify(ProductList, sellerId);

			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@SuppressWarnings("static-access")
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetProductList_002() {
		Logger.start(true, "商品Id null-查所有商品");
		try {
			getproductlistBean.setPage_no(2);
			getproductlistBean.setPage_rows(10);

			OpenApiWapper openApiWapper = new OpenApiWapper();

			Application application = openApiWapper
					.selectApplicationBySellerId(
							Long.valueOf(EnvSetup.getData("productsellerid")))
					.get(0);

			String app_id = application.getApp_id();
			String app_secret = application.getApp_secret();

			AuthCode authCode = openApiWapper.selectAuthCodeByAppId(app_id)
					.get(0);

			openapiReq.setApp_id(app_id);
			openapiReq.setSign_method("MD5");
			openapiReq.setAuth_code(authCode.getAuth_code());
			openapiReq.setTimestamp(YMTDateUtil.getSysTime());
			openapiReq.setNonce_str(TestDataManager.getRandomNum(31));
			openapiReq.setBiz_content(new FormatUtil()
					.beanToGSONString(getproductlistBean));
			openapiReq.setSign(OpenapiService.generateMD5(openapiReq,
					AesUtil.decrypt(app_secret)));

			String url = String
					.format("http://apigateway.ymatou.com/apigateway/v1?app_id=%s&method=ymatou.products.list.get",
							app_id);
			getproductlistCall.setUrl(url);

			getproductlistCall.setData(openapiReq);
			getproductlistCall.callService();

			Logger.verifyEquals("0000", getproductlistCall.getCode(),
					"验证返回Code");

			ProductList ProductList = getproductlistCall.getProductList();
			Logger.verifyEquals(true, ProductList.getTotal_count() > 0,
					"验证返回total_count");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@SuppressWarnings("static-access")
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetProductList_003() {
		Logger.start(true, "商品Id不存在");
		try {

			Thread.sleep(1000);

			List<String> productid_list = new ArrayList<>();
			productid_list.add(TestDataManager.getRandomNum(8));
			productid_list.add(TestDataManager.getRandomNum(8));
			productid_list.add(TestDataManager.getRandomNum(8));
			productid_list.add(TestDataManager.getRandomNum(8));

			getproductlistBean.setProductid_list(productid_list);
			getproductlistBean.setPage_no(1);
			getproductlistBean.setPage_rows(10);

			OpenApiWapper openApiWapper = new OpenApiWapper();

			Application application = openApiWapper
					.selectApplicationBySellerId(
							Long.valueOf(EnvSetup.getData("productsellerid")))
					.get(0);

			String app_id = application.getApp_id();
			String app_secret = application.getApp_secret();

			AuthCode authCode = openApiWapper.selectAuthCodeByAppId(app_id)
					.get(0);

			openapiReq.setApp_id(app_id);
			openapiReq.setSign_method("MD5");
			openapiReq.setAuth_code(authCode.getAuth_code());
			openapiReq.setTimestamp(YMTDateUtil.getSysTime());
			openapiReq.setNonce_str(TestDataManager.getRandomNum(31));
			openapiReq.setBiz_content(new FormatUtil()
					.beanToGSONString(getproductlistBean));
			openapiReq.setSign(OpenapiService.generateMD5(openapiReq,
					AesUtil.decrypt(app_secret)));

			String url = String
					.format("http://apigateway.ymatou.com/apigateway/v1?app_id=%s&method=ymatou.products.list.get",
							app_id);
			getproductlistCall.setUrl(url);

			getproductlistCall.setData(openapiReq);
			getproductlistCall.callService();

			Logger.verifyEquals("0000", getproductlistCall.getCode(),
					"验证返回Code");

			ProductList ProductList = getproductlistCall.getProductList();
			Logger.verifyEquals(0, ProductList.getTotal_count(),
					"验证返回total_count");
			Logger.verifyEquals(0, ProductList.getProduct_infos().size(),
					"验证返回Product_infos");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@SuppressWarnings("static-access")
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetProductList_004() {
		Logger.start(true, "商品Id与Seller不匹配");
		try {
			int sellerId = Integer.valueOf(EnvSetup.getData("SellerId2"));
			String sellerName = EnvSetup.getData("SellerName");

			org.json.JSONObject addNewProductOnSaleObject = SellerProductCallService
					.addNewProductOnSale(sellerId, sellerName, null);
			String productID1 = addNewProductOnSaleObject.getJSONObject("Data")
					.getString("ProductId");

			addNewProductOnSaleObject = SellerProductCallService
					.addNewProductOnSale(sellerId, sellerName, null);
			String productID2 = addNewProductOnSaleObject.getJSONObject("Data")
					.getString("ProductId");

			addNewProductOnSaleObject = SellerProductCallService
					.addNewProductOnSale(sellerId, sellerName, null);
			String productID3 = addNewProductOnSaleObject.getJSONObject("Data")
					.getString("ProductId");

			addNewProductOnSaleObject = SellerProductCallService
					.addNewProductOnSale(sellerId, sellerName, null);
			String productID4 = addNewProductOnSaleObject.getJSONObject("Data")
					.getString("ProductId");

			Thread.sleep(1000);

			List<String> productid_list = new ArrayList<>();
			productid_list.add(productID1);
			productid_list.add(productID2);
			productid_list.add(productID3);
			productid_list.add(productID4);

			getproductlistBean.setProductid_list(productid_list);
			getproductlistBean.setPage_no(1);
			getproductlistBean.setPage_rows(10);

			OpenApiWapper openApiWapper = new OpenApiWapper();

			Application application = openApiWapper
					.selectApplicationBySellerId(
							Long.valueOf(EnvSetup.getData("productsellerid")))
					.get(0);

			String app_id = application.getApp_id();
			String app_secret = application.getApp_secret();

			AuthCode authCode = openApiWapper.selectAuthCodeByAppId(app_id)
					.get(0);

			openapiReq.setApp_id(app_id);
			openapiReq.setSign_method("MD5");
			openapiReq.setAuth_code(authCode.getAuth_code());
			openapiReq.setTimestamp(YMTDateUtil.getSysTime());
			openapiReq.setNonce_str(TestDataManager.getRandomNum(31));
			openapiReq.setBiz_content(new FormatUtil()
					.beanToGSONString(getproductlistBean));
			openapiReq.setSign(OpenapiService.generateMD5(openapiReq,
					AesUtil.decrypt(app_secret)));

			String url = String
					.format("http://apigateway.ymatou.com/apigateway/v1?app_id=%s&method=ymatou.products.list.get",
							app_id);
			getproductlistCall.setUrl(url);

			getproductlistCall.setData(openapiReq);
			getproductlistCall.callService();

			Logger.verifyEquals("0000", getproductlistCall.getCode(),
					"验证返回Code");

			ProductList ProductList = getproductlistCall.getProductList();
			Logger.verifyEquals(0, ProductList.getTotal_count(),
					"验证返回total_count");
			Logger.verifyEquals(0, ProductList.getProduct_infos().size(),
					"验证返回Product_infos");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@SuppressWarnings({ "static-access" })
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetProductList_006() {
		Logger.start(true, "传入商品上架的开始和结束时间，时间区内没有任何商品");
		try {
			Thread.sleep(1000);

			List<String> productid_list = new ArrayList<>();
			
			getproductlistBean.setProductid_list(productid_list);
			getproductlistBean.setPage_no(1);
			getproductlistBean.setPage_rows(10);
			getproductlistBean.setStart_updated("2010-07-19 13:25:51");
			getproductlistBean.setEnd_updated("2010-10-19 20:25:51");

			OpenApiWapper openApiWapper = new OpenApiWapper();

			Application application = openApiWapper
					.selectApplicationBySellerId(
							Long.valueOf(EnvSetup.getData("productsellerid")))
					.get(0);

			String app_id = application.getApp_id();
			String app_secret = application.getApp_secret();

			AuthCode authCode = openApiWapper.selectAuthCodeByAppId(app_id)
					.get(0);

			openapiReq.setApp_id(app_id);
			openapiReq.setSign_method("MD5");
			openapiReq.setAuth_code(authCode.getAuth_code());
			openapiReq.setTimestamp(YMTDateUtil.getSysTime());
			openapiReq.setNonce_str(TestDataManager.getRandomNum(31));
			openapiReq.setBiz_content(new FormatUtil()
					.beanToGSONString(getproductlistBean));
			openapiReq.setSign(OpenapiService.generateMD5(openapiReq,
					AesUtil.decrypt(app_secret)));

			String url = String
					.format("http://apigateway.ymatou.com/apigateway/v1?app_id=%s&method=ymatou.products.list.get",
							app_id);
			getproductlistCall.setUrl(url);

			getproductlistCall.setData(openapiReq);
			getproductlistCall.callService();

			Logger.verifyEquals("0000", getproductlistCall.getCode(),
					"验证返回Code");

			ProductList ProductList = getproductlistCall.getProductList();
			Logger.verifyEquals(0, ProductList.getTotal_count(),
					"验证返回total_count");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@SuppressWarnings({ "static-access" })
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetProductList_007() {
		Logger.start(true, "传入商品上架的开始和结束时间，查找时间区间内的商品");
		try {
			int sellerId = Integer.valueOf(EnvSetup.getData("SellerId2"));

			List<String> productid_list = new ArrayList<>();
			
			getproductlistBean.setProductid_list(productid_list);
			getproductlistBean.setPage_no(1);
			getproductlistBean.setPage_rows(1);
			getproductlistBean.setStart_updated("2017-07-19 13:25:51");
			getproductlistBean.setEnd_updated("2017-10-19 20:25:51");

			OpenApiWapper openApiWapper = new OpenApiWapper();

			Application application = openApiWapper
					.selectApplicationBySellerId(
							Long.valueOf(EnvSetup.getData("productsellerid")))
					.get(0);

			String app_id = application.getApp_id();
			String app_secret = application.getApp_secret();

			AuthCode authCode = openApiWapper.selectAuthCodeByAppId(app_id)
					.get(0);

			openapiReq.setApp_id(app_id);
			openapiReq.setSign_method("MD5");
			openapiReq.setAuth_code(authCode.getAuth_code());
			openapiReq.setTimestamp(YMTDateUtil.getSysTime());
			openapiReq.setNonce_str(TestDataManager.getRandomNum(31));
			openapiReq.setBiz_content(new FormatUtil()
					.beanToGSONString(getproductlistBean));
			openapiReq.setSign(OpenapiService.generateMD5(openapiReq,
					AesUtil.decrypt(app_secret)));

			String url = String
					.format("http://apigateway.ymatou.com/apigateway/v1?app_id=%s&method=ymatou.products.list.get",
							app_id);
			getproductlistCall.setUrl(url);

			getproductlistCall.setData(openapiReq);
			getproductlistCall.callService();

			Logger.verifyEquals("0000", getproductlistCall.getCode(),
					"验证返回Code");

			ProductList ProductList = getproductlistCall.getProductList();
			Logger.verifyEquals(373, ProductList.getTotal_count(),
					"验证返回total_count");
			this.verify(ProductList, sellerId);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@SuppressWarnings({ "static-access" })
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetProductList_008() {
		Logger.start(true, "传入商品上架的开始、结束时间和指定的商品，无视时间区间内的商品，只查找指定商品信息");
		try {
			int sellerId = Integer.valueOf(EnvSetup.getData("productsellerid"));
			String sellerName = EnvSetup.getData("productsellername");

			String productID = TradingProductVo.createPro((long) sellerId,
					sellerName, 10).getProductId();

			String productID2 = TradingProductVo.createPro((long) sellerId,
					sellerName, 10).getProductId();

			Thread.sleep(1000);

			List<String> productid_list = new ArrayList<>();
			productid_list.add(productID);
			productid_list.add(productID2);
			
			getproductlistBean.setProductid_list(productid_list);
			getproductlistBean.setPage_no(1);
			getproductlistBean.setPage_rows(10);
			getproductlistBean.setStart_updated("2017-07-19 13:25:51");
			getproductlistBean.setEnd_updated("2017-10-19 20:25:51");

			OpenApiWapper openApiWapper = new OpenApiWapper();

			Application application = openApiWapper
					.selectApplicationBySellerId(
							Long.valueOf(EnvSetup.getData("productsellerid")))
					.get(0);

			String app_id = application.getApp_id();
			String app_secret = application.getApp_secret();

			AuthCode authCode = openApiWapper.selectAuthCodeByAppId(app_id)
					.get(0);

			openapiReq.setApp_id(app_id);
			openapiReq.setSign_method("MD5");
			openapiReq.setAuth_code(authCode.getAuth_code());
			openapiReq.setTimestamp(YMTDateUtil.getSysTime());
			openapiReq.setNonce_str(TestDataManager.getRandomNum(31));
			openapiReq.setBiz_content(new FormatUtil()
					.beanToGSONString(getproductlistBean));
			openapiReq.setSign(OpenapiService.generateMD5(openapiReq,
					AesUtil.decrypt(app_secret)));

			String url = String
					.format("http://apigateway.ymatou.com/apigateway/v1?app_id=%s&method=ymatou.products.list.get",
							app_id);
			getproductlistCall.setUrl(url);

			getproductlistCall.setData(openapiReq);
			getproductlistCall.callService();

			Logger.verifyEquals("0000", getproductlistCall.getCode(),
					"验证返回Code");

			ProductList ProductList = getproductlistCall.getProductList();
			Logger.verifyEquals(2, ProductList.getTotal_count(),
					"验证返回total_count");
			this.verify(ProductList, sellerId);

			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@SuppressWarnings("static-access")
	@Test
	@Category({P1.class})
	@TestCase
	/*	stag 霓虹买买买
	select * from application where seller_id=15511872 ;
	select * from auth_code where seller_id=15511872 ;*/
	public void Tc_GetProductList_005() {
		Logger.start(true, "获取单个商品详细信息-stg");
		try {

			String app_id = "0Y6XVHaj7kjsoEcvGg";
			String app_secret = "5340AA34A5D6A154066F5074B31BA672149B88B399F6611450BB931952F3EE3277A049D2CAB92FF1E467219E19726988";
			String auth_code = "04MvSmEWQvF07g4U98uHsViKAJYlot5r";

			String productID1 = "76896270-bbc1-4d15-9238-59633f6d1c6e";
			/*String productID2 = "3a08d75b-6d7b-44f8-bb08-5867f1eb08bc";
			String productID3 = "256ba993-6400-49d4-83b9-02bb6fdac235";
			String productID4 = "8402ed6a-383b-42ca-914e-ea158e65f299";*/

			List<String> productid_list = new ArrayList<>();
			productid_list.add(productID1);

			/*			productid_list.add(productID2);
						productid_list.add(productID3);
						productid_list.add(productID4);*/

			getproductlistBean.setProductid_list(productid_list);
			getproductlistBean.setPage_no(1);
			getproductlistBean.setPage_rows(10);

			openapiReq.setApp_id(app_id);
			openapiReq.setSign_method("MD5");
			openapiReq.setAuth_code(auth_code);
			openapiReq.setTimestamp(YMTDateUtil.getSysTime());
			openapiReq.setNonce_str(TestDataManager.getRandomNum(31));
			openapiReq.setBiz_content(new FormatUtil()
					.beanToGSONString(getproductlistBean));

			openapiReq.setSign(OpenapiService.generateMD5(openapiReq,
					AesUtil.decrypt(app_secret)));

			String url = String
					.format("https://open.ymatou.com/apigateway/v1?app_id=%s&method=ymatou.products.list.get",
							app_id);
			getproductlistCall.setUrl(url);

			getproductlistCall.setData(openapiReq);
			getproductlistCall.callService();

			Logger.verifyEquals("0000", getproductlistCall.getCode(),
					"验证返回Code");

			ProductList ProductList = getproductlistCall.getProductList();

			Logger.info("Total_count:" + ProductList.getTotal_count());

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}